import request from './request'

function requestt(data) {
    if (data.method == 'get') {
        return request.get(data.url, data)
    }
    if (data.method == 'post') {
        return request.post(data.url, data)
    }
}

// 栏目-列表
export function columnList(data) {
    return request.post(`column/list`, data)
}

// 栏目-新增
export function columnCreate(data) {
    return request.post(`column/create`, data)
}

// 栏目-获取修改内容
export function columnDetail(data) {
    console.log(data, 'data')
    return request.get(`column/detail/${data}`)

}

// 栏目-修改
export function columnUpdate(data) {
    console.log(data, 'data')
    return request.post(`column/update/${data.id}`, data)

}

// 栏目-删除
export function columnDelete(id) {
    console.log(id, 'data')
    return request.delete(`column/delete/${id}`)

}
// 栏目-修改状态

export function columnStatus(data) {
    console.log(data, 'data')
    return request.post(`column/status/${data.id}`, { status: data.status })

}


// 栏目内容--新增
export function contentCreate(data) {
    console.log(data, 'data')
    return request.post(`column/content/create`, data)

}
// 栏目内容-列表
export function contentList(data) {
    return request.post(`column/content/list`, data)
}
// 栏目内容-获取修改内容
export function contentDetail(data) {
    console.log(data, 'data')
    return request.get(`column/content/detail/${data}`)

}

export function contentUpdate(data) {
    console.log(data, 'data')
    return request.post(`column/content/update/${data.id}`, data)

}
// 栏目内容-修改状态
export function contentStatus(data) {
    console.log(data, 'data')
    return request.post(`column/content/status/${data.id}`, { status: data.status })

}
// 修改是否是热门状态
export function contentIs_hot(data) {
    console.log(data, 'data')
    return request.post(`column/content/hot/${data.id}`, { status: data.is_hot })

}
// 栏目-删除
export function contentDelete(id) {
    console.log(id, 'data')
    return request.delete(`column/content/delete/${id}`)

}